#include <iostream>
#include "lexer/Lexer.h"

using namespace std;

Lexer lexer;
Token* tokenArray[100];

int main() {
    lexer.init();
    FILE *fp = fopen("/Users/kz/compiler/test.c", "r");

    Token *token;
    int cnt = 0;
    while (true) {
        token = lexer.tokenize(fp);
        if(token->tag != Tag::SPACE) {
            tokenArray[cnt] = token;

            if(token->tag != Tag::EOL) {
                cout << token->toString();
            } else {
                cout << endl;
            }
            cnt++;
        }
        if (token->tag == Tag::ENDF) {
            break;
        }
    }
    return 0;
}